<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
    <title>弓友之家</title>
    <link rel="stylesheet" href="css/mui.css" />
    <link rel="stylesheet" href="fonts/iconfont.css" />
    <link rel="stylesheet" href="css/style.css" />
</head>
<body>
	<header class="mui-bar mui-bar-nav">
		<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
		<h1 class="mui-title">经验交流</h1>
		<a class="mui-icon mui-icon-more-filled mui-pull-right shareBtn"></a>
	</header>
	<div class="mui-content">
		<div class="experience-page">
			<div class="header">
				<h4><span>帖子</span><font id="title"></font></h4>
				<p id="c_time">2017-1-1</p>
			</div>
			<article>
			</article>
		</div>
	</div>
	<br /><br /><br />
	<!--分享-->
	<div class="shareWx mui-hidden"> 
		<ul class="mui-list-unstyled">
			<li class="tel"><a href="javascript:void(0)" onclick="shareWeixinMessage(1)">微信好友</a></li>
			<li class="qq"><a href="javascript:void(0)" onclick="shareWeixinMessage(2)">朋友圈</a></li>
		</ul>
		<button type="button" class="cancleShare">取消</button>
	</div>
	<script type="text/javascript" src="js/mui.min.js" ></script>
	<script type="text/javascript" src="js/jquery-1.8.3.min.js" ></script>
	<script type="text/javascript" src="js/common.js" ></script>
	<script type="text/javascript" src="js/mui.zoom.js" ></script>
	<script type="text/javascript" src="js/mui.previewimage.js" ></script>
	<script type="text/javascript" charset="utf-8">
      	mui.init();
      	var id="";
      	var expimg="";
  		var exptit="";
  		var expdesc=""; 
      	mui.plusReady(function(){
      		var _self=plus.webview.currentWebview();
      		id=_self.nid;
      		mui.ajax(H_SRC+'/amier/index/exp_detail',{
				data:{
					id:id,
					token:token
				},
				dataType:'json',//服务器返回json格式数据
				type:'post',//HTTP请求类型
				timeout:10000,//超时时间设置为10秒；            
				success:function(data){
					var dataurl=data.data;
					if(data.code == 401)
					{
						mui.openWindow({
							url:'login.html',
							id:'login.html'
						})
					}else if(data.code == 1) 
					{
						$("#title").html(dataurl.title);
						$("#c_time").html(dataurl.c_time);
						$("article").html(dataurl.content);
						for(var i=0;i<$("article img").length;i++){
							var src=H_SRC+''+$("article img").eq(i).attr("src");
    						$("article img").eq(i).attr("src",src);  
    						$("article img").eq(i).attr("data-preview-src","");
    						$("article img").eq(i).attr("data-preview-group","1"); 
						}
						mui.previewImage();
						expdesc=$("article").text().substr(0,50);
						exptit=dataurl.title;
						expimg=H_SRC+dataurl.thumb;
					}else{ 
						mui.toast(data.msg);
					}
				},
				error:function(){
				}
			}) 
      	})
      	
      	function shareWeixinMessage(type){
			var type=type;
			if(type==1){
				var secne="WXSceneSession"
			}else{
				var secne="WXSceneTimeline"
			}
			sharewx.send( 
				{ 
					title:exptit,
					content:expdesc, 
					href:H_SRC+'/news/'+id,
					thumbs: [expimg], 
		        	pictures: [expimg], 
					extra:{scene:secne}
				}, 
				function(){
					mask.close();
					$(".shareWx").addClass("mui-hidden");
					mui.toast( "分享成功！" );
				}, function(e){
					mask.close();
					$(".shareWx").addClass("mui-hidden");
					mui.toast( "取消分享");
				}
			);
		}
    </script>
</body>
</html>